﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections.Specialized;

namespace PachubePlugin
{
    public partial class frmConfig : Form
    {
        public bool Enabled;
        public string APIKey;
        public string FeedId;
        public decimal Interval;

        public frmConfig(NameValueCollection current)
        {
            InitializeComponent();
            try
            {
                chkEnabled.Checked = bool.Parse(current["pachubeplugin_enabled"]);
                txtApiKey.Text = current["pachubeplugin_apikey"];
                txtFeedId.Text = current["pachubeplugin_feedid"];
                nudInterval.Value = decimal.Parse(current["pachubeplugin_interval"]);
            }
            catch
            {
                // ignore
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Enabled = chkEnabled.Checked;
            APIKey = txtApiKey.Text;
            FeedId = txtFeedId.Text;
            Interval = nudInterval.Value;
        }

    }
}
